#include <iostream>
using namespace std;
int main()
{
	int tou,jiao,tu,ji;
	cin>>tou>>jiao;
	tu=(jiao-2*tou)/2;
	ji=tou-tu;
	cout<<ji<<" "<<tu;
	return 0;
}
